package com.xb;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @program: register-jerry
 * @description:
 * @author: xu.bin
 * @create: 2020-11-08
 */
public class AtomicIngerDemo {
    private static Integer i = 0;
    private static AtomicInteger atomicInteger = new AtomicInteger(0);

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread() {
                @Override
                public void run() {
                    System.out.println(AtomicIngerDemo.atomicInteger.incrementAndGet());
                }
            }.start();
        }
    }
}